The ridgeline plot above visualizes the distribution of Airbnb review scores across different Edinburgh neighborhoods, ordered by their respective median review scores. The neighborhoods with the highest overall reviews appear at the top of the plot with a descending order down the plot to the neighborhoods with the lowest review scores. Most review scores cluster tightly between 90 and 100 (x-axis), suggesting generally positive experiences overall in the set of reviews. However, some neighborhoods display broader distributions or lower medians. A broader distribution indicates that the reviews have a larger spread along the review spectrum.
2 - Foreign Connected PACs
# get a list of files with "Foreign Connected PAC" in their nameslist_of_files <-dir_ls(path ="data", regexp ="Foreign Connected PAC")# read all files and row bind them# keeping track of the file name in a new column called yearpac <-read_csv(list_of_files, id ="year") |>glimpse()
ggplot(data = swiss_spending, aes(x = year, y = totals /1e6, color = party)) +geom_line() +scale_color_manual(values =c("repubs"="red", "dems"="blue"),labels =c("Democrats", "Republicans")) +scale_x_continuous(breaks =seq(1996, 2022, by =4),labels =seq(1996, 2022, by =4)) +scale_y_continuous(labels =function(x) paste0("$", round(x), "M")) +labs(title ="Contributions to US political parties from Swiss-connected PACs",color ="Party",x ="Year",y ="Total amount",caption ="Source: OpenSecrets.org") +theme(axis.title.y =element_text(margin =margin(t =0, r =0, b =0, l =0), hjust =0),axis.title.x =element_text(margin =margin(t =0, r =0, b =0, l =0), hjust =0),legend.position =c(0.87, 0.15))
Intepretation
Contributions from Swiss-connected PACs to U.S. political parties have grown since the year 2000. The peak around key election years. The data shows a clear preference for Republican candidates, especially from 2008 onward. This might reflect Swiss alignment of ideologies or policies with Republican platforms. In contrast, Democratic contributions also grew, though they remained more modest and stable over the yearly span of this dataset.
ggplot(data = penguins,aes(x = bill_len, y = body_mass, color = island)) +geom_point() +labs(x ="Bill Length (mm)",y ="Body Mass (g)",title ="Penguin Body Mass Positively Correlates with Bill Length",subtitle ="By Island",color ="Island")
Found a useful source for changing background panel colors (R-charts 2023). I changed the background colors of most parts of the graph, including axis text. If you look closely, I also flipped the axis tick mark labels 180 degrees, as well as the x-axis label upside down. Why not?
ggplot(data = penguins,aes(x = bill_len, y = body_mass, color = island,shape = species)) +geom_point(size =10) +scale_color_manual(values =c("magenta", "chartreuse", "yellow")) +labs(x ="Bill Length (mm)",y ="Body Mass (g)",title ="Penguin Body Mass Positively Correlates with Bill Length",subtitle ="By Island",color ="Island",shape ="Species") +theme_dark() +theme(panel.grid.minor.x =element_blank(),panel.grid.major.x =element_blank(),panel.grid.minor.y =element_blank(),panel.grid.major.y =element_blank(),plot.background =element_rect(fill ="magenta"), ## magenta backgroundpanel.background =element_rect(fill ="cyan"), ## cyan panelpanel.grid.major =element_line(color ="chartreuse"), ## bright green gridlinespanel.grid.minor =element_line(color ="chartreuse"), ## bright green minor gridlinesaxis.text =element_text(color ="yellow", angle =180), ## yellow axis tick labelsaxis.title =element_text(color ="yellow", angle =180), ## yellow axis titleslegend.background =element_rect(fill ="chartreuse"), ## bright green legend backgroundlegend.text =element_text(color ="magenta") ## magenta legend text)